import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/dashboard'
        },
		{
		    path: '/register',
		    component: () => import(/* webpackChunkName: "login" */ '../components/page/register.vue'),
		},
		{
		    path: '/changepassword',
		    component: () => import(/* webpackChunkName: "login" */ '../components/page/changepassword.vue'),
		},
        {
            path: '/',
            component: () => import(/* webpackChunkName: "home" */ '../components/common/Home.vue'),
            meta: { title: '自述文件' },
            children: [
                {
                    path: '/dashboard',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/Dashboard.vue'),
                    meta: { title: '首页' }
                },
                // {
                //     path: '/icon',
                //     component: () => import(/* webpackChunkName: "icon" */ '../components/page/Icon.vue'),
                //     meta: { title: '自定义图标' }
                // },
                // {
                //     path: '/table',
                //     component: () => import(/* webpackChunkName: "table" */ '../components/page/BaseTable.vue'),
                //     meta: { title: '基础表格' }
                // },
                {
                    path: '/historytable',
                    component: () => import(/* webpackChunkName: "table" */ '../components/page/historytable.vue'),
                    meta: { title: '历史信息表格' }
                },
                // {
                //     path: '/tabs',
                //     component: () => import(/* webpackChunkName: "tabs" */ '../components/page/Tabs.vue'),
                //     meta: { title: 'tab选项卡' }
                // },
                {
                    // vue-schart组件
                    path: '/moischarts',
                    component: () => import(/* webpackChunkName: "chart" */ '../components/page/moisturecharts.vue'),
                    meta: { title: '土壤湿度图表' }
                },
				{
				    // vue-schart组件
				    path: '/tempcharts',
				    component: () => import(/* webpackChunkName: "chart" */ '../components/page/tempchart.vue'),
				    meta: { title: '温度图表' }
				},
				{
				    // vue-schart组件
				    path: '/intensitycharts',
				    component: () => import(/* webpackChunkName: "chart" */ '../components/page/intensitycharts.vue'),
				    meta: { title: '光照强度图表' }
				},
				{
				    // vue-schart组件
				    path: '/humidcharts',
				    component: () => import(/* webpackChunkName: "chart" */ '../components/page/humidchart.vue'),
				    meta: { title: '湿度图表' }
				},
				

            ]
        },
        {
            path: '/login',
            component: () => import(/* webpackChunkName: "login" */ '../components/page/Login.vue'),
            meta: { title: '登录' }
        },
		{
		    path: '/register',
		    component: () => import(/* webpackChunkName: "login" */ '../components/page/register.vue'),
		    meta: { title: '注册' }
		},
    ]
});
